package com.px.dal;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.px.idal.IAwardInfoMapper;
import com.px.model.AwardInfo;
import com.px.mybatisunit.MyBatisUtil;

public class AwardsMapper {
	// 创建SqlSession对象的实例
		SqlSession session = MyBatisUtil.getsqlSession(true);
		// IUserInfoMapper接口通过sqlsession的getmap方法,完成实现,全部自动化
		IAwardInfoMapper mapper = session.getMapper(IAwardInfoMapper.class);

		// 查询所有奖项
		public List<AwardInfo> getAllAwards() {
			return mapper.getAllawards();
		}

		// 增加奖项
		public int insertAwards(AwardInfo awards) {
			return mapper.insertAwards(awards);
		};

		// 更新指定awards_id的奖项的
		public int updateAdwardsByAdardsName(AwardInfo awards) {
			return mapper.updateAdwardsByAdardsId(awards);
		};

		// 删除指定awards_id的奖项
		public int deleteAdwardsByAdardsId(Integer awards_id) {
			return mapper.deleteAdwardsByAdardsId(awards_id);
		};
		// 查询指定id用户
		public List<AwardInfo> selectAdwardsByAdardsId(AwardInfo awards) {
			return mapper.selectAdwardsByAdardsId(awards);
		}

		// 查询奖项信息总条数
		public int getAllAwardsCounts() {
			return mapper.getAllAwardsCounts();
		};

		// 查询指定奖项名奖项是否存在
		public int checkAdwardsIdIsExist(AwardInfo awards) {
			return mapper.checkAdwardsIdIsExist(awards);
		}



}
